-
Notifications
You must be signed in to change notification settings - Fork 38
Refactor treesitter filetype detection #281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I have no idea, why tests are failed. |
Thank you. Is there any precedent in the vim/neovim ecosystem for calling an embedded file type something like If it's a custom extension I would be hesitant to merge the PR. |
No conflicts with vim/nvim. |
I changed filetype separator to ".", this is more vim-like. This doesn't affect anything, just for consistency. |
@hrsh7th |
Hi, man. |
What I'm wondering is that this function is so useful and versatile that a standard mechanism will eventually be implemented in the neovim core. In other words, if we choose Apart from that, I think For now, let's merge with |
So, should I revert separator back from "." to "/" and you will merge? |
yes :) |
Filetype separator reverted to "/". |
thank you |
Thank you! |
This patch allows to flexibly define snippets for injected languages.
Now
treesitter
filetype detector returns two filetypes:For example, for
lua
injected intovim
script it will retirn:This will allow users to configure snippets more flexibly. For example, if I want to add some snippets for
lua
code, injected intovim
, for examplevim.print( $1 )
, I will need to setup filetypes mapping like this:So for regular
lua
scriptlua.json
snippets will be used, and for injectedvim/lua
-lua.json
andvim/lua.json
.